//
//  AboutUsTableViewCell.m
//  WJTheWishPro
//
//  Created by appleLJ on 2018/1/19.
//  Copyright © 2018年 dwj. All rights reserved.
//

#import "AboutUsTableViewCell.h"

@interface AboutUsTableViewCell ()
@property(nonatomic,strong) UILabel *titleLabel;
@property(nonatomic,strong) UIImageView *rightImgView;
@end
@implementation AboutUsTableViewCell
- (void)setDataDic:(NSDictionary *)dataDic
{
    self.titleLabel.text = dataDic[@"articletitle"];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.separatorInset = UIEdgeInsetsZero;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        //添加控件
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.rightImgView];
        //约束
        __weak __typeof(self)weakSelf = self;
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf).offset(10 / WIDTH_5S_SCALE);
            make.centerY.equalTo(weakSelf);
        }];
        [self.rightImgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(weakSelf).offset(-10 / WIDTH_5S_SCALE);
            make.width.mas_equalTo(10 / WIDTH_5S_SCALE);
            make.height.mas_equalTo(15 / WIDTH_5S_SCALE);
            make.centerY.equalTo(weakSelf);
        }];
    }
    return self;
}

#pragma mark -- init

- (UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.font = DEF_FontSize_14;
        _titleLabel.textColor = getColor(blackColor);
        _titleLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _titleLabel;
}

- (UIImageView *)rightImgView{
    if (!_rightImgView) {
        _rightImgView = [[UIImageView alloc] init];
        _rightImgView.image = [UIImage imageNamed:@"list_wjleftimg"];
    }
    return _rightImgView;
}

@end
